package com.ddstation.onsitelaw.service;


import com.ddstation.onsitelaw.entity.auditentity.MaDataDictionaryEntity;
import com.ddstation.onsitelaw.mapper.MaDataDictionaryMapper;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.inject.Inject;
import java.util.List;


@Service
@Lazy
public class DataDictionaryServiceImpl implements DataDictionaryService {
	//数据字典数据取得
	@Override
	@Transactional(readOnly=true)
	public List<MaDataDictionaryEntity> getCodeList(String codeKey){
		
		List<MaDataDictionaryEntity> list = maDataDictionaryMapper.selectByCategoryId(codeKey);
		if ( list == null || list.size()==0 ){
			throw new RuntimeException("ma_data_dictionary表中无["+codeKey+"]数据，请设置！");
		}
		
		return list;
	}
	
	@Inject private MaDataDictionaryMapper maDataDictionaryMapper;
}